package com.ccys.db.mapper;

import com.ccys.db.dto.masterData.PricingTimingPageQueryDto;
import com.ccys.db.entity.TblPricingTiming;
import com.ccys.db.vo.masterData.PricingTimingPageQueryVo;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import tk.mybatis.mapper.common.MySqlMapper;

import java.math.BigDecimal;
import java.util.List;

/**
* Created by Mybatis Generator on 2023/12/08
*/
public interface TblPricingTimingMapper extends Mapper<TblPricingTiming>, MySqlMapper<TblPricingTiming> {
    List<PricingTimingPageQueryVo> findPage(PricingTimingPageQueryDto dto);

    BigDecimal findValueByCountryIdAndByTime(@Param("countryId") String countryId,@Param("time") String time);

    /**
     *
     * @param timeStr 当前时间 例如：08:30
     * @param countryId 国家ID
     * @param dayOfTheWeek 星期几，注意这里的星期几数字为：0-星期一，以此类推6-星期天
     * @return 当前时间段最大的费用，如果为空则返回0
     */
    BigDecimal findMaxFeeByTime(@Param("timeStr") String timeStr,@Param("countryId") String countryId,@Param("dayOfTheWeek") int dayOfTheWeek);


    /**
     * 获取节假日的fee
     * @param timezone 国家所在时区 +8:00
     * @param countryId 国家id
     * @return fee
     * @author xly
     */
    BigDecimal getMaxValueByOfficeType(String timezone,String countryId,Integer dayOfTheWeek);

}
